package com.zkl.user.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zkl.user.model.UserAccountChangeRecord;
import com.zkl.user.mapper.UserAccountChangeRecordMapper;
import com.zkl.user.service.UserAccountChangeRecordService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.apache.commons.lang3.StringUtils;

import java.util.List;
/**
 * <p>
 * 用户账户变动记录表 服务实现类
 * </p>
 *
 * @author gongxz
 * @since 2020-01-15
 */
@Service
@Transactional
public class UserAccountChangeRecordServiceImpl extends ServiceImpl<UserAccountChangeRecordMapper, UserAccountChangeRecord> implements UserAccountChangeRecordService {

    @Autowired
    private UserAccountChangeRecordMapper userAccountChangeRecordMapper;

    @Override
    public IPage<UserAccountChangeRecord> selectPage(Page<UserAccountChangeRecord> page, UserAccountChangeRecord userAccountChangeRecord) {
        QueryWrapper<UserAccountChangeRecord> queryWrapper = new QueryWrapper<UserAccountChangeRecord>();
        getQueryWrapper(queryWrapper,userAccountChangeRecord);
        return userAccountChangeRecordMapper.selectPage(page,queryWrapper);
    }

    @Override
    public List<UserAccountChangeRecord> selectList(UserAccountChangeRecord userAccountChangeRecord) {
        QueryWrapper<UserAccountChangeRecord> queryWrapper = new QueryWrapper<UserAccountChangeRecord>();
        getQueryWrapper(queryWrapper,userAccountChangeRecord);
        return userAccountChangeRecordMapper.selectList(queryWrapper);
    }

    /**
     *  公共查询条件
     * @param queryWrapper
     * @return
     */
    public QueryWrapper<UserAccountChangeRecord> getQueryWrapper(QueryWrapper<UserAccountChangeRecord> queryWrapper,UserAccountChangeRecord userAccountChangeRecord){
        //条件拼接
    
        return queryWrapper;
    }
}
